package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.project.entity.PreOutOrder;
import com.project.entity.Product;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lovo
 * @since 2023-07-21
 */
public interface PreOutOrderMapper extends BaseMapper<PreOutOrder> {
    /**
     * 按客户ID、销售员ID查询出库单信息集合
     * @param customId customId
     * @param userId 销售员ID
     * @return
     */
    public List<PreOutOrder> findById(@Param("customId") Integer customId,@Param("userId") Integer userId);

    /**
     * 按商品ID、客户ID、销售员ID查询出库表中记录数
     * @param productId
     * @param customId
     * @param sellerId
     * @return
     */
    public int countPreOrderNum(@Param("productId") Integer productId, @Param("customId") Integer customId, @Param("sellerId") Integer sellerId);

    /**
     * 按客户ID查询商品集合
     * @param customId 客户ID
     * @return 商品集合
     */
    public List<PreOutOrder> findListByCustomId(Integer customId);
}
